//
//  GlobalPublicDefine.h
//  CoolTalk
//
//  Created by admin on 15/9/18.
//  Copyright (c) 2015年 BreazeMago. All rights reserved.
//

#ifndef CoolTalk_GlobalPublicDefine_h
#define CoolTalk_GlobalPublicDefine_h

//========================================================================//
/**
 *  公共配置宏定义
 */
//========================================================================//


#define SuppressPerformSelectorLeakWarning(Stuff) \
do { \
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Warc-performSelector-leaks\"") \
Stuff; \
_Pragma("clang diagnostic pop") \
} while (0)

#pragma mark 颜色配置
//颜色
#define RGBACOLOR(r,g,b,a)  [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:(a)]
#define RGB(r, g, b)        [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:1.0f]
#define KHStyleColor        RGB(248, 248, 248)          //导航栏
#define KHBackGroundColor   RGB(242, 242, 242)          //uiviewcontroller背景色
#define KHTitleLineColor    RGB(178, 178, 178)          //导航栏底部颜色
#define KHListLineColor     RGB(222, 222, 222)          //线条颜色
#define KHTabBarLineColor   RGB(178, 178, 178)          //tabbar 顶部颜色

#define KHDialViewLineColor RGB(203, 203, 193)          //拨号盘线色
#define KHListNorColor      RGB(255, 255, 255)          //uitableviewcell 正常颜色
#define KHListSelColor      RGB(234, 234, 234);        //uitableviewcell 选中时的颜色 10%透明

#define kWSButtonNormalColor    [UIColor colorWithRed:6/255.0 green:191/255.0 blue:4/255.0 alpha:1.0]
#define kWSButtonHighlightColor [UIColor colorWithRed:2/255.0 green:157/255.0 blue:0/255.0 alpha:1.0]

// 全局使用的字体颜色
#define kGlobalTextColorNormal  RGBACOLOR(54.0f, 190.0f, 9.0f, 1.0f)
#define kGlobalTextColorHighted RGBACOLOR(54.0f, 190.0f, 9.0f, 0.5f)

#pragma mark 系统宏
#define ScWidth             [[UIScreen mainScreen] bounds].size.width   //获取屏幕宽度
#define ScHeight            [[UIScreen mainScreen] bounds].size.height  //获取屏幕高度

#define isIOS7              ([[UIDevice currentDevice].systemVersion floatValue] >= 7.0f)
#define isIOS8              ([[UIDevice currentDevice].systemVersion floatValue] >= 8.0f)
#define isIOS9              ([[UIDevice currentDevice].systemVersion floatValue] >= 9.0f)
#define is4inch             ((568 == [[UIScreen mainScreen] bounds].size.height)? YES : NO)
#define is35inch            ((480 == [[UIScreen mainScreen] bounds].size.height)? YES : NO)

#define NAV_VIEW_HEIGHT     (isIOS7 ? 64 : 44)
#define NAV_VIEW_Y          (isIOS7 ? 0 : 20)

//App版本号
#define kAppVersion         [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]

//手机系统版本
#define IOS_VERSION         [[[UIDevice currentDevice] systemVersion] floatValue]

//是否为iphone4/4s
#define iphone4  ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 960), [[UIScreen mainScreen] currentMode].size) : NO)
//是否iPhone6
#define iPhone6             ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? \
CGSizeEqualToSize(CGSizeMake(750, 1334), [[UIScreen mainScreen] currentMode].size) : NO)
//是否iPhone6Plus
#define iPhone6Plus         ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? \
CGSizeEqualToSize(CGSizeMake(1242, 2208), [[UIScreen mainScreen] currentMode].size) : NO)
//是否iPad
#define iPAD                ([[UIDevice currentDevice] respondsToSelector:@selector(userInterfaceIdiom)] && \
[[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
//比例
#define SCALE               (ceilf([UIScreen mainScreen].bounds.size.width / 160.0f)/2.0f)
//加载本地图片
#define LoadImageWithPNGType(file) [BJEFileManager imageNamedOrigin:file]


#pragma mark 业务宏
#define KEY_IS_FIRSTLAUNCH          @"is_firstlaunch"
#define kCZQueryCostDetailFlag      @"kCZQueryCostDetailFlag"       //查询收支明细flag
#define kCZDefaultConfigFlagKey     @"kCZDefaultConfigFlagKey"      //默认配置flag
#define kCZRechargePayTypeListKey   @"kCZRechargePayTypeListKey"    //支付充值方式列表key

#define kCZRechargeGoodsFlagKey     @"kCZRechargeGoodsFlagKey"      //商品列表flag
#define kCZRechargeGoodsListKey     @"kCZRechargeGoodsListKey"      //商品充值列表key

#define kCZKeyPressSoundOnOff       @"kCZKeyPressSoundOnOff"        //按键音设置开关
#define kCZSpeechRemindOnOff        @"kCZSpeechRemindOnOff"         //语音提醒设置开关

#define kCZWiFiCallBackOnOff        [NSString stringWithFormat:@"kCZWiFiCallBackOnOff_%@",[CacheDataUtil valueForKey:@"uid"]]   //wifi下回拨设置开关，与账户uid关联
#define kCZ3G4GCallBackOnOff        [NSString stringWithFormat:@"kCZ3G4GCallBackOnOff_%@",[CacheDataUtil valueForKey:@"uid"]]   //3g,4g下回拨设置开关，与账户uid关联

#define kCZCallBackDataDic          @"kCZCallBackDataDic"         //回拔挂断所属数据字典标识

#define kCZAutoAnswerCallOnOff      @"kCZAutoAnswerCallOnOff"       //自动接听

#define kCZCostIncomeURLKey         @"kCZIncomeURLKey"              //话费收入URL
#define kCZCostExpendURLKey         @"kCZCostExpendURLKey"          //话费支出URL

#define kHiddenFunctionKey          @"kHiddenFunctionKey"           //隐藏功能key


//友盟appkey
#define kUMENG_APPKEY               @"5534cde167e58e50de0023ca"


/**********************其它配置*****************************/
typedef enum
{
    DialOutType = 0, //拨出
    AnswerType = 1,  //接听
    MissedType = 2,    //回拨
}Calltype;//通话类型

typedef enum
{
    FreeType = 0,       //免费
    DirectType = 1,     //直播
    CallbackType = 2,   //回拨
}Dailtype;//通话类型

typedef enum{
    nick_name = 0, //呢称
    phone = 1,
    number170 = 2,
    gender = 3,
    birthday = 4,
    email = 5,
    memo  = 6
} modifyuserinfoType;

// 用户相关
#define kHUID                   @"kHUID"            // 用户ID
#define kHUsername              @"kHUsername"       // 用户名
#define kHUserPhone             @"kHUserPhone"      // 用户手机号码
#define kHPassword              @"kHPassword"       // 密码


// 版本更新相关
#define kHUpdateURL             @"kHUpdateURL"      // 更新地址
#define kHVersions              @"kHVersions"       // 最新版本号

#define ClientNumKey            @"clientNumkey"
#define ClientPassKey           @"clientPasskey"

#define kKuMiTeamName           @"酷秘团队"
#define kKefuName               @"客服"
//定位－国家
#pragma mark -定位宏
#define  CCCountry       @"CCCountry"
#define  isInland        @"isInland"

//是否已经强制重新登录过，针对2.3.2版本
#define kNewVersionHadReLogined           @"kNewVersionHadReLogined2.3.2"

#endif
